package com.ruoyi.common.core.utils;/**
 * @InterfaceName: MyMesssage
 * @Description:
 * @Author: YourName
 * @Date: 2023-04-05
 */

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 *@InterfaceName: MyMesssage
 *@Description:
 *@Author: lilirui
 *@Date: 2023-04-05
 */
@Data
public class MyMesssage implements Serializable {
    @NotNull(message = "cmd不能为空")
    String cmd;
    @NotNull(message = "roomId不能为空")
    String roomId;
    String uid;
    String remoteUid;
    String msg;

    public MyMesssage(String s){
        JSONObject jsonObject = JSON.parseObject(s);
        this.cmd= (String) jsonObject.get("cmd");
        this.roomId= (String) jsonObject.get("roomId");
        this.uid= (String) jsonObject.get("uid");
        this.remoteUid= (String) jsonObject.get("remoteUid");
        this.msg= (String) jsonObject.get("msg");
    }

    public MyMesssage() {

    }
}
